#include<bits/stdc++.h>
using namespace std;
#define int long long

int a[1005];

signed main() {
    int n, m;
    cin >> n >> m;

    int sum = 0;
    for(int i = 1; i <= m; i++) {
        cin >> a[i];
        sum += a[i];
    }

    if((m - 1) * n >= sum)
        cout << 0;
    else
        cout << sum - (m - 1) * n;
    return 0;
}

